/*
 * XML Type:  XComboBox
 * Namespace: http://www.seedwill.com/xul/widget/
 * Java type: com.seedwill.xul.widget.XComboBox
 *
 * Automatically generated - do not modify.
 */
package com.seedwill.xul.widget.impl;
/**
 * An XML XComboBox(@http://www.seedwill.com/xul/widget/).
 *
 * This is a complex type.
 */
public class XComboBoxImpl extends com.seedwill.xul.widget.impl.XInputImpl implements com.seedwill.xul.widget.XComboBox
{
    private static final long serialVersionUID = 1L;
    
    public XComboBoxImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName TEXT$0 = 
        new javax.xml.namespace.QName("", "text");
    private static final javax.xml.namespace.QName ITEMS$2 = 
        new javax.xml.namespace.QName("", "items");
    private static final javax.xml.namespace.QName SELECTEDITEMCHANGEDEVT$4 = 
        new javax.xml.namespace.QName("", "selectedItemChangedEvt");
    private static final javax.xml.namespace.QName SELECTEDINDEXCHANGEDEVT$6 = 
        new javax.xml.namespace.QName("", "selectedIndexChangedEvt");
    private static final javax.xml.namespace.QName DEFAULTSELECTEDITEM$8 = 
        new javax.xml.namespace.QName("", "defaultSelectedItem");
    private static final javax.xml.namespace.QName DEFAULTSELECTEDINDEX$10 = 
        new javax.xml.namespace.QName("", "defaultSelectedIndex");
    
    
    /**
     * Gets the "text" element
     */
    public java.lang.String getText()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TEXT$0, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "text" element
     */
    public org.apache.xmlbeans.XmlString xgetText()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(TEXT$0, 0);
            return target;
        }
    }
    
    /**
     * True if has "text" element
     */
    public boolean isSetText()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(TEXT$0) != 0;
        }
    }
    
    /**
     * Sets the "text" element
     */
    public void setText(java.lang.String text)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TEXT$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(TEXT$0);
            }
            target.setStringValue(text);
        }
    }
    
    /**
     * Sets (as xml) the "text" element
     */
    public void xsetText(org.apache.xmlbeans.XmlString text)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(TEXT$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(TEXT$0);
            }
            target.set(text);
        }
    }
    
    /**
     * Unsets the "text" element
     */
    public void unsetText()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(TEXT$0, 0);
        }
    }
    
    /**
     * Gets array of all "items" elements
     */
    public com.seedwill.xul.core.XPairItem[] getItemsArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(ITEMS$2, targetList);
            com.seedwill.xul.core.XPairItem[] result = new com.seedwill.xul.core.XPairItem[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "items" element
     */
    public com.seedwill.xul.core.XPairItem getItemsArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPairItem target = null;
            target = (com.seedwill.xul.core.XPairItem)get_store().find_element_user(ITEMS$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "items" element
     */
    public int sizeOfItemsArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(ITEMS$2);
        }
    }
    
    /**
     * Sets array of all "items" element
     */
    public void setItemsArray(com.seedwill.xul.core.XPairItem[] itemsArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(itemsArray, ITEMS$2);
        }
    }
    
    /**
     * Sets ith "items" element
     */
    public void setItemsArray(int i, com.seedwill.xul.core.XPairItem items)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPairItem target = null;
            target = (com.seedwill.xul.core.XPairItem)get_store().find_element_user(ITEMS$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(items);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "items" element
     */
    public com.seedwill.xul.core.XPairItem insertNewItems(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPairItem target = null;
            target = (com.seedwill.xul.core.XPairItem)get_store().insert_element_user(ITEMS$2, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "items" element
     */
    public com.seedwill.xul.core.XPairItem addNewItems()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPairItem target = null;
            target = (com.seedwill.xul.core.XPairItem)get_store().add_element_user(ITEMS$2);
            return target;
        }
    }
    
    /**
     * Removes the ith "items" element
     */
    public void removeItems(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(ITEMS$2, i);
        }
    }
    
    /**
     * Gets the "selectedItemChangedEvt" element
     */
    public com.seedwill.xul.widget.XEvent getSelectedItemChangedEvt()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XEvent target = null;
            target = (com.seedwill.xul.widget.XEvent)get_store().find_element_user(SELECTEDITEMCHANGEDEVT$4, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "selectedItemChangedEvt" element
     */
    public boolean isSetSelectedItemChangedEvt()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(SELECTEDITEMCHANGEDEVT$4) != 0;
        }
    }
    
    /**
     * Sets the "selectedItemChangedEvt" element
     */
    public void setSelectedItemChangedEvt(com.seedwill.xul.widget.XEvent selectedItemChangedEvt)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XEvent target = null;
            target = (com.seedwill.xul.widget.XEvent)get_store().find_element_user(SELECTEDITEMCHANGEDEVT$4, 0);
            if (target == null)
            {
                target = (com.seedwill.xul.widget.XEvent)get_store().add_element_user(SELECTEDITEMCHANGEDEVT$4);
            }
            target.set(selectedItemChangedEvt);
        }
    }
    
    /**
     * Appends and returns a new empty "selectedItemChangedEvt" element
     */
    public com.seedwill.xul.widget.XEvent addNewSelectedItemChangedEvt()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XEvent target = null;
            target = (com.seedwill.xul.widget.XEvent)get_store().add_element_user(SELECTEDITEMCHANGEDEVT$4);
            return target;
        }
    }
    
    /**
     * Unsets the "selectedItemChangedEvt" element
     */
    public void unsetSelectedItemChangedEvt()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(SELECTEDITEMCHANGEDEVT$4, 0);
        }
    }
    
    /**
     * Gets the "selectedIndexChangedEvt" element
     */
    public com.seedwill.xul.widget.XEvent getSelectedIndexChangedEvt()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XEvent target = null;
            target = (com.seedwill.xul.widget.XEvent)get_store().find_element_user(SELECTEDINDEXCHANGEDEVT$6, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "selectedIndexChangedEvt" element
     */
    public boolean isSetSelectedIndexChangedEvt()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(SELECTEDINDEXCHANGEDEVT$6) != 0;
        }
    }
    
    /**
     * Sets the "selectedIndexChangedEvt" element
     */
    public void setSelectedIndexChangedEvt(com.seedwill.xul.widget.XEvent selectedIndexChangedEvt)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XEvent target = null;
            target = (com.seedwill.xul.widget.XEvent)get_store().find_element_user(SELECTEDINDEXCHANGEDEVT$6, 0);
            if (target == null)
            {
                target = (com.seedwill.xul.widget.XEvent)get_store().add_element_user(SELECTEDINDEXCHANGEDEVT$6);
            }
            target.set(selectedIndexChangedEvt);
        }
    }
    
    /**
     * Appends and returns a new empty "selectedIndexChangedEvt" element
     */
    public com.seedwill.xul.widget.XEvent addNewSelectedIndexChangedEvt()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XEvent target = null;
            target = (com.seedwill.xul.widget.XEvent)get_store().add_element_user(SELECTEDINDEXCHANGEDEVT$6);
            return target;
        }
    }
    
    /**
     * Unsets the "selectedIndexChangedEvt" element
     */
    public void unsetSelectedIndexChangedEvt()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(SELECTEDINDEXCHANGEDEVT$6, 0);
        }
    }
    
    /**
     * Gets the "defaultSelectedItem" element
     */
    public com.seedwill.xul.core.XPairItem getDefaultSelectedItem()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPairItem target = null;
            target = (com.seedwill.xul.core.XPairItem)get_store().find_element_user(DEFAULTSELECTEDITEM$8, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "defaultSelectedItem" element
     */
    public boolean isSetDefaultSelectedItem()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(DEFAULTSELECTEDITEM$8) != 0;
        }
    }
    
    /**
     * Sets the "defaultSelectedItem" element
     */
    public void setDefaultSelectedItem(com.seedwill.xul.core.XPairItem defaultSelectedItem)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPairItem target = null;
            target = (com.seedwill.xul.core.XPairItem)get_store().find_element_user(DEFAULTSELECTEDITEM$8, 0);
            if (target == null)
            {
                target = (com.seedwill.xul.core.XPairItem)get_store().add_element_user(DEFAULTSELECTEDITEM$8);
            }
            target.set(defaultSelectedItem);
        }
    }
    
    /**
     * Appends and returns a new empty "defaultSelectedItem" element
     */
    public com.seedwill.xul.core.XPairItem addNewDefaultSelectedItem()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPairItem target = null;
            target = (com.seedwill.xul.core.XPairItem)get_store().add_element_user(DEFAULTSELECTEDITEM$8);
            return target;
        }
    }
    
    /**
     * Unsets the "defaultSelectedItem" element
     */
    public void unsetDefaultSelectedItem()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(DEFAULTSELECTEDITEM$8, 0);
        }
    }
    
    /**
     * Gets the "defaultSelectedIndex" element
     */
    public int getDefaultSelectedIndex()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DEFAULTSELECTEDINDEX$10, 0);
            if (target == null)
            {
                return 0;
            }
            return target.getIntValue();
        }
    }
    
    /**
     * Gets (as xml) the "defaultSelectedIndex" element
     */
    public org.apache.xmlbeans.XmlInt xgetDefaultSelectedIndex()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlInt target = null;
            target = (org.apache.xmlbeans.XmlInt)get_store().find_element_user(DEFAULTSELECTEDINDEX$10, 0);
            return target;
        }
    }
    
    /**
     * True if has "defaultSelectedIndex" element
     */
    public boolean isSetDefaultSelectedIndex()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(DEFAULTSELECTEDINDEX$10) != 0;
        }
    }
    
    /**
     * Sets the "defaultSelectedIndex" element
     */
    public void setDefaultSelectedIndex(int defaultSelectedIndex)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DEFAULTSELECTEDINDEX$10, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(DEFAULTSELECTEDINDEX$10);
            }
            target.setIntValue(defaultSelectedIndex);
        }
    }
    
    /**
     * Sets (as xml) the "defaultSelectedIndex" element
     */
    public void xsetDefaultSelectedIndex(org.apache.xmlbeans.XmlInt defaultSelectedIndex)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlInt target = null;
            target = (org.apache.xmlbeans.XmlInt)get_store().find_element_user(DEFAULTSELECTEDINDEX$10, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlInt)get_store().add_element_user(DEFAULTSELECTEDINDEX$10);
            }
            target.set(defaultSelectedIndex);
        }
    }
    
    /**
     * Unsets the "defaultSelectedIndex" element
     */
    public void unsetDefaultSelectedIndex()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(DEFAULTSELECTEDINDEX$10, 0);
        }
    }
}
